package com.yundasys.lab02springbootstudy.listener;

import com.yundasys.lab02springbootstudy.event.CustomizeEvent;
import com.yundasys.lab02springbootstudy.util.Utils;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Service;

/**
 * 自定义的系统广播监听器，只接受CustomizeEvent类型的消息
 * @author jiangta
 * @version 1.0
 * @date 2021/1/20 1:52 下午
 */
@Service
public class CustomizeEventListener implements ApplicationListener<CustomizeEvent> {

    @Override
    public void onApplicationEvent(CustomizeEvent customizeEvent) {
        //为了便于了解调用栈，在日志中打印当前堆栈
        Utils.printTrack("onApplicationEvent : " + customizeEvent);
    }
}
